package com.weseal.utils;

import com.weseal.query.MasterInfoQuery;
import org.apache.shiro.authc.UsernamePasswordToken;

/**
 * @author weseal
 * @title
 * @description
 * @usage
 * @copyright Copyright 2014  rrmj Corporation. All rights reserved.
 * @company 上海众多美网络科技有限公司
 * @create 2017/11/1
 */
public class MasterUserPasswordToken extends UsernamePasswordToken {

	private MasterInfoQuery masterInfoQuery;

	public MasterUserPasswordToken(MasterInfoQuery masterInfoQuery) {
		this.setUsername(masterInfoQuery.getLoginName());
		this.setPassword(masterInfoQuery.getPassword().toCharArray());
		this.setHost(masterInfoQuery.getIp());
		this.masterInfoQuery = masterInfoQuery;
	}

	public MasterInfoQuery getMasterInfoQuery() {
		return masterInfoQuery;
	}

	public void setMasterInfoQuery(MasterInfoQuery masterInfoQuery) {
		this.masterInfoQuery = masterInfoQuery;
	}
}
